from rediscluster import StrictRedisCluster as RedisCluster
startup_nodes = [
    {
        # 'host': '192.168.0.98',
        'host': 'ubuntu_xiaochaihu',
        'port': '7000'
    },
    {
        'host': 'ubuntu_xiaochaihu',
        'port': '7001'
    },
    {
        'host': 'ubuntu_xiaochaihu',
        'port': '7002'
    },
    {
        'host': 'ubuntu_xiaochaihu',
        'port': '7003'
    },
    {
        'host': 'ubuntu_xiaochaihu',
        'port': '7004'
    },
    {
        'host': 'ubuntu_xiaochaihu',
        'port': '7005'
    },
]

rc = RedisCluster(startup_nodes=startup_nodes)

print rc
for node in startup_nodes:
    print node

print rc.get('age')
print rc.get('name')
print rc.set('name', 'new name')
print rc.hset('user:007', 'name', '008')
print rc.get('name')
print rc.hget('user:007', 'name')
print rc.hget('user:007', 'age')
print rc.hgetall('user:007')
